/* static/css/schedule_view.css */

/* ===== 日期栏 ===== */
#date-bar {
    position: relative;
    width: 100%;
    height: 2.5rem;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

/* 前一天/后一天按钮 */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    border: none;
    background: none;
    color: #495057;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.nav-btn:hover {
    background-color: #f1f3f5;
    border-radius: 0.25rem;
}

#prev-day {
    left: 0.5rem;
}

#next-day {
    right: 0.5rem;
}

/* 中间日期显示及隐藏的原生 input */
.date-display-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    cursor: pointer;
    user-select: none;
}

#display-date {
    font-size: 0.95rem;
    color: #343a40;
}

.date-display-container input[type="date"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
    margin: 0;
}

/* ===== 排课卡片 ===== */
/* static/css/schedule_view.css */

/* —— 卡片整体样式 —— */
.schedule-card {
    display: flex;
    width: 100%;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    box-sizing: border-box;
    padding: 0; /* 内边距移到子项 */
}

/* —— 卡片行 —— */
.schedule-card .card-row {
    display: flex;
    width: 100%;
}

/* —— 左侧时间列 —— */
.schedule-card .time-col {
    flex: 0 0 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #e7f5ff;
    color: #0d6efd;
    font-weight: 600;
    border-top-left-radius: 0.75rem;
    border-bottom-left-radius: 0.75rem;
    padding: 0.5rem 0;
    margin: 0;
}

.schedule-card .time-col .start-time,
.schedule-card .time-col .end-time {
    font-size: 0.875rem;
}

.schedule-card .time-col .mid-line {
    margin: 0.25rem 0;
}

/* —— 右侧详情区：两列网格布局 —— */
.schedule-card .details-grid {
    display: grid;
    /* 第一列：学生／课程列 80px；第二列：中心列自适应；第三列：状态列 40px */
    grid-template-columns: 90px 1fr 75px;
    grid-template-rows: auto auto;
    column-gap: 0.5rem;
    row-gap: 0.5rem;
    padding: 0.75rem 0.5rem 0.5rem 1rem;
}

/* 学生姓名（第1行，第1列） */
.schedule-card .details-grid .student {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.schedule-card .details-grid .grade,
.schedule-card .details-grid .school {
  grid-column: 2;        /* 均放在中间列 */
  justify-self: left;  /* 水平居中 */
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 状态按钮（跨两行，第3列），始终右侧 */
.schedule-card .details-grid .status {
    grid-column: 3;
    grid-row: 1 / span 2;
    justify-self: end;
    align-self: start;
    display: flex;
    align-items: center;
}

/* 课程名（第2行，第1列） */
.schedule-card .details-grid .course {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.schedule-card .details-grid .school {
  grid-row: 2;           /* 强制放在第二行 */
}

/* —— 隐藏旧的占位 —— */
.schedule-card .details-grid .empty {
    display: none;
}

/* —— 图标和文字间距 —— */
.schedule-card .details-grid i {
    margin-right: 0.25rem;
    flex-shrink: 0;
}

/* —— 按钮样式 —— */
.schedule-card .btn-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.schedule-card .btn-status.btn-outline-primary {
    color: #0d6efd;
    border-color: #0d6efd;
}

.schedule-card .btn-status.btn-outline-primary:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

/* —— 响应式溢出处理 —— */
.schedule-card .details-grid > * {
    min-width: 0;
}

/* —— 过长文本省略号 —— */
.schedule-card .details-grid .student span,
.schedule-card .details-grid .grade span,
.schedule-card .details-grid .course span,
.schedule-card .details-grid .school span {
    display: inline-block;
    width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
